/**
 * @author 木人心
 * @version 1.0.0
 */
import { RouteLocationNormalized } from 'vue-router'
import Security from '@/router/interceptor/security'

export const RouteSecurity = {
  welcomePath: '/login',
  routeCheck (to: RouteLocationNormalized) {
    return Security.init(to)
      // 允许所有请求
      // .anyRequest().permitAll()
      // 无需认证可访问
      .antMatchers([
        this.welcomePath,
        '/register',
        '/retrieve-password',
        '/show-draw',
        '/login/cosplay',
        '/we-applet/**',
        '/privacy',
        '/test/**'
        // '/abc',
        // '/abc/abc',
        // '/abc/abc/*',
        // '/abc/abc/**',
      ]).permitAll()
      // 需授权
      // .antMatchers([
      // ]).authorizedCheck()
      // 其余需认证
      .anyRequest().authenticated()
      .getResult()
  }
}
